home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 06 - 1990 / 06.01 Jan 90 / Jan Jorg Source / MacTutorApp.h < prev    next >
Encoding:
Text File  |  1989-11-19  |  1.5 KB  |  57 lines  |  [TEXT/MPS ]

  1. // Constants, resource definitions, etc.
  2.  
  3. #define kErrStrings     129
  4.  
  5. /* The following are indicies into STR# resources. */
  6. #define    eNoMemory                1
  7. #define    eNoWindow                2
  8.  
  9. #define kMinSize                48 // min heap needed in K
  10.  
  11. #define    rMenuBar    128                /* application's menu bar */
  12. #define    rAboutAlert    128                /* about alert */
  13. #define    rDocWindow    128                /* application's window */
  14.  
  15. #define    mApple                    128        /* Apple menu */
  16. #define    iAbout                    1
  17.  
  18. #define    mFile                    129        /* File menu */
  19. #define    iNew                    1
  20. #define    iClose                    4
  21. #define    iQuit                    12
  22.  
  23. #define    mEdit                    130        /* Edit menu */
  24. #define    iUndo                    1
  25. #define    iCut                    3
  26. #define    iCopy                    4
  27. #define    iPaste                    5
  28. #define    iClear                    6
  29.  
  30. #define    myMenu                    131        /* Sample menu */
  31. #define    item1                    1
  32. #define    item2                    2
  33. #define    item3                    3
  34. #define    item5                    5
  35.  
  36. class TMacTutorApp : public TApplication {
  37. public:
  38.     TMacTutorApp(void);                // Our constructor
  39.  
  40. private:
  41.     // routines from TApplication we are overriding
  42.     long HeapNeeded(void);
  43.     unsigned long SleepVal(void);
  44.     void AdjustMenus(void);
  45.     void DoMenuCommand(short menuID, short menuItem);
  46.  
  47.     // routines for our own devious purposes
  48.     void DoNew(void);
  49.     void Terminate(void);
  50. };
  51.  
  52. // kMaxOpenDocuments is used to determine whether a new document can be opened
  53. // or created. We keep track of the number of open documents, and disable the
  54. // menu items that create a new document when the maximum is reached. If the
  55. // number of documents falls below the maximum, the items are enabled again. */
  56. const short    kMaxOpenDocuments = 4;
  57.